<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function sum(num){
            if (num>0) {
                alert('必须大于0')
                return
            }
            let s=parseInt(num%60)
            let m=parseInt(num/60%60)
            let h=parseInt(num/60/60%24)
            s=s>10?s:'0'+s
            m=m>10?m:'0'+m
            h=h>=10?h:'0'+h
            document.write(`${h}小时${m}分钟${s}秒`)
        }
        sum(+prompt('输入秒数'))
    </script>
</body>
</html>